<?php

class Application_Form_Customer extends Zend_Form
{

    public function init()
    {
    	$this->setName("customer");
        
        $cust_no = new Zend_Form_Element_Hidden('cust_no');
        $cust_no->addFilter('Int');
        
        $cust_title = new Zend_Form_Element_Select('cust_title');
        $cust_title->setLabel('Title')
        	->setMultiOptions(array(null=>'----------', 'Mr'=>'Mr', 'Mrs'=>'Mrs', 'Ms'=>'Ms', 'Miss'=>'Miss'))
        	->setRequired(true)
        	->addValidator('NotEmpty', true)
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left')
        	->addErrorMessage('Cannot be empty');
        $cust_first_name = new Zend_Form_Element_Text('cust_first_name');
        $cust_first_name->setLabel('First Name')
        	->setRequired(true)
        	->addFilter('StripTags')
        	->addFilter('StringTrim')
        	->addValidator('NotEmpty')
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left')
        	->addErrorMessage('Cannot be empty');
        $cust_last_name = new Zend_Form_Element_Text('cust_last_name');
        $cust_last_name->setLabel('Last Name')
        	->setRequired(true)
        	->addFilter('StripTags')
        	->addFilter('StringTrim')
        	->addValidator('NotEmpty')
        	->setAttrib('id', 'openright')
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'right')
        	->addErrorMessage('Cannot be empty');
        $cust_address = new Zend_Form_Element_Text('cust_address');
        $cust_address->setLabel('Address')
        	->setRequired(true)
        	->addFilter('StripTags')
        	->addFilter('StringTrim')
        	->addValidator('NotEmpty')
        	->setAttrib('class', 'long')
        	->setAttrib('id', 'left');
        $cust_suburb = new Zend_Form_Element_Text('cust_suburb');
        $cust_suburb->setLabel('Suburb')
        	->setRequired(true)
        	->addFilter('StripTags')
        	->addFilter('StringTrim')
        	->addValidator('NotEmpty')
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left')
        	->addErrorMessage('Cannot be empty');
        $cust_state = new Zend_Form_Element_Select('cust_state');
        $cust_state->setLabel('State')
        	->setMultiOptions(array(null=>'----------', 'ACT'=>'ACT', 'NSW'=>'NSW', 'QLD'=>'QLD', 'VIC'=>'VIC', 'SA'=>'SA', 'WA'=>'WA', 'NT'=>'NT', 'TAS'=>'TAS'))
        	->setRequired(false)
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'right');
        $cust_post_code = new Zend_Form_Element_Text('cust_post_code');
        $cust_post_code->setLabel('Post Code')
        	->setRequired(true)
        	->addValidator('Digits')
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left');
        $cust_home_phone = new Zend_Form_Element_Text('cust_home_phone');
        $cust_home_phone->setLabel('Home Phone')
        	->setRequired(false)
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left')
        	->addValidator('Digits');
        $cust_work_phone = new Zend_Form_Element_Text('cust_work_phone');
        $cust_work_phone->setLabel('Work Phone')
        	->setRequired(false)
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'right')
        	->addValidator('Digits');
        $cust_mobile_phone = new Zend_Form_Element_Text('cust_mobile_phone');
        $cust_mobile_phone->setLabel('Mobile Phone')
        	->setRequired(false)
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left')
        	->addValidator('Digits');
        $cust_pay_method = new Zend_Form_Element_Select('cust_pay_method');
        $cust_pay_method->setLabel('Pay Method')
        	->setMultiOptions(array(null=>'----------', 'Debit Card'=>'Debit Card', 'Credit Card'=>'Credit Card', 'BPay'=>'BPay', 'PayPal'=>'PayPal'))
        	->setRequired(true)
        	->setAttrib('class', 'short')
        	->setAttrib('id', 'left')
        	->addErrorMessage('Cannot be empty');
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('class', 'submit')
        	->setAttrib('id', 'opener');
        
        $ck_form_title = new Zend_Form_Element_Hidden('ck_cust_title');
        $ck_form_first_name = new Zend_Form_Element_Hidden('ck_cust_first_name');
        $ck_form_last_name = new Zend_Form_Element_Hidden('ck_cust_last_name');
        $ck_form_address = new Zend_Form_Element_Hidden('ck_cust_address');
        $ck_form_suburb = new Zend_Form_Element_Hidden('ck_cust_suburb');
        $ck_form_state = new Zend_Form_Element_Hidden('ck_cust_state');
        $ck_form_post_code = new Zend_Form_Element_Hidden('ck_cust_post_code');
        $ck_form_home_phone = new Zend_Form_Element_Hidden('ck_cust_home_phone');
        $ck_form_work_phone = new Zend_Form_Element_Hidden('ck_cust_work_phone');
        $ck_form_mobile_phone = new Zend_Form_Element_Hidden('ck_cust_mobile_phone');
        $ck_form_pay_method = new Zend_Form_Element_Hidden('ck_cust_pay_method');
        
        $this->addElements(array($cust_no, $cust_title, $ck_form_title, $cust_first_name, $ck_form_first_name, $cust_last_name, $ck_form_last_name, $cust_address, $ck_form_address, $cust_suburb, $ck_form_suburb, $cust_state, $ck_form_state, $cust_post_code, $ck_form_post_code, $cust_home_phone, $ck_form_home_phone, $cust_work_phone, $ck_form_work_phone, $cust_mobile_phone, $ck_form_mobile_phone, $cust_pay_method, $ck_form_pay_method, $submit));
    }

}

